package domain;

import physical.CardReader;
import util.Calculator;

import java.text.DecimalFormat;

public class Withdrawal extends Transaction{

    private String result;

    public Withdrawal(Account account) {
        super(account);
        setTransType("CWD");
    }

    public String getResult() {
        return result;
    }


    @Override
    public void updateAmount(String amount){
        super.setAmount(amount);
        this.result = decimalFormat.format(Calculator.conversion(getCurBalance() + '-' + amount));
		getAccount().getBalance().setBalance(result);
	}

}

